package com.lg.erp.controller.zhangchaofu;

import com.lg.erp.entity.JsonResult;
import com.lg.erp.entity.zhangchaofu.CTWare;
import com.lg.erp.mapper.zhangchaofu.CTWareMapper;
import com.lg.erp.service.zhangchaofu.ICTWareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CTWareController{

    @Autowired
    private CTWareMapper wareMapper;
    @Autowired
    private ICTWareService wareService;

    @GetMapping("/wares")
    public JsonResult getWare(){
        List<CTWare> wares = wareService.findWare();
        wares.forEach(System.out::println);
        return new JsonResult(1,"ok",wares);
    }

    @GetMapping("/wareEach")
    public JsonResult getWares(){
        List<CTWare> wareList = wareService.list();
        return new JsonResult(1,"ok",wareList);
    }

    @GetMapping("/wares2")
    public JsonResult findWare(){
        List<CTWare> ctWares = wareService.list();
        return new JsonResult(1,"ok",ctWares);
    }

}
